Skip to content

Port StatementRewrite::rewrite_unique_id#1174

Merged
sgrif merged 3 commits into
mainfrom
sg-port-rewrite-unique-id
Jul 10, 2026
Merged

Port StatementRewrite::rewrite_unique_id#1174
sgrif merged 3 commits into
mainfrom
sg-port-rewrite-unique-id

Conversation

@sgrif

@sgrif sgrif commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

This is mostly a direct port, other than lifting where we get the UniqueId generator up a level so rewrite_unique_id can be infallible. (NB: The only reason getting the generator can fail is if the config is invalid. We should be checking that config way earlier, and fetching the generator should be infallible).

This marks the final function in StatementRewrite that needed to be ported. We can now begin the structural change of removing the old AST from that struct entirely. However, that will be a large enough change on its own to warrant a separate PR, so as of this commit we still do the deparse/reparse/deparse/reparse dance.

This is mostly a direct port, other than lifting where we get the
UniqueId generator up a level so `rewrite_unique_id` can be infallible.
(NB: The only reason getting the generator can fail is if the config is
invalid. We should be checking that config way earlier, and fetching the
generator should be infallible).

This marks the final function in `StatementRewrite` that needed to be
ported. We can now begin the structural change of removing the old AST
from that struct entirely. However, that will be a large enough change
on its own to warrant a separate PR, so as of this commit we still do
the deparse/reparse/deparse/reparse dance.
@sgrif sgrif requested a review from meskill July 10, 2026 13:55
levkk
levkk previously approved these changes Jul 10, 2026
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.69767% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ntend/router/parser/rewrite/statement/unique_id.rs 90.69% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

@levkk levkk dismissed their stale review July 10, 2026 14:14

I NO LONGER APPROVE

@sgrif sgrif requested a review from levkk July 10, 2026 20:29
@sgrif sgrif merged commit 89bc406 into main Jul 10, 2026
24 checks passed
@sgrif sgrif deleted the sg-port-rewrite-unique-id branch July 10, 2026 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants